namespace Billing
{
    using AjaxControlToolkit;
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using Microsoft.Security.Application;

    public class MasterPage : System.Web.UI.MasterPage
    {
        protected ContentPlaceHolder ContentPlaceHolder1;
        protected HtmlForm form1;
        protected ContentPlaceHolder head;
        protected Image ImgBUImage;
        protected Label lblCurrentDateTime;
        protected Label lblFooter;
        protected Label lblGroupName;
        protected Label lblHeader;
        protected Label lblloginName;
        protected ToolkitScriptManager ToolkitScriptManager1;
        protected TreeView TreeView1;

        private void BindTree()
        {
            if (LoginUser.TreeMenu != null)
            {
                new ClsTreeHelper { PageName = this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5) + ".aspx", dt = LoginUser.TreeMenu, controlTreeView = this.TreeView1 }.AddTree(0, null);
            }
            else
            {
                base.Response.Redirect("default.aspx", true);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.Session["BUID"] == null)
            {
                base.Response.Redirect("default.aspx", true);
            }
            if (!this.Page.IsPostBack)
            {
                this.BindTree();
                this.lblGroupName.Text = Encoder.HtmlEncode(LoginUser.GroupName);
                this.lblloginName.Text = Encoder.HtmlEncode(LoginUser.DisplayName);
                this.lblCurrentDateTime.Text = Encoder.HtmlEncode(LoginUser.CurrentLoginDateTime);
            }
            
        }

        protected void Page_PreInit(object sender, EventArgs e)
        {
            try
            {
                string IsLogin = LoginUser.LoginID;
            }
            catch
            {
                base.Response.Redirect("default.aspx", true);
            }
        }
    }
}
